package cn.hl.hm.util.chinapay;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import cn.hl.hm.constants.ModelConfig;

public class PathUtil {
	private static Properties properties = null;
	static{
		try {
			if(ModelConfig.status.equals("0")){
				InputStream is = PathUtil.class.getResourceAsStream(ModelConfig.cp_test);
				properties = new Properties();
				properties.load(is);
			}else {
				InputStream is = PathUtil.class.getResourceAsStream(ModelConfig.cp_onlie);
				properties = new Properties();
				properties.load(is);
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	/**
	 * 根据key值取得对应的value�?
	 * @param key
	 * @return
	 */
	public static String getValue(String key) {
		return properties.getProperty(key);
	}
}
